﻿<%@ Page Title="" Language="C#" MasterPageFile="~/System/System.master" AutoEventWireup="true" CodeFile="AccessRoles.aspx.cs" Inherits="System_Pages_Security_AccessRoles" %>
<%@ Register Src="~/System/Controls/Common/FileManagerTreeView.ascx" TagName="TreeViewFileManger" TagPrefix="ucc" %>
<%@ Register Src="~/System/Controls/FieldTemplates/MessageText.ascx" TagName="MessageText" TagPrefix="ucc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SiteFox_Left" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SiteFox_Title" Runat="Server">
    <asp:Image ID="img_Title" runat="server" ImageUrl="~/System/Design/ico/32x32/users2.png" ToolTip="<%$ Resources:dcCommon, dc_UsersAndRoles %>" />
    <asp:Label ID="lab_Title" runat="server" Text="<%$ Resources:dcCommon, dc_AccessRoles %>" />
    <asp:UpdatePanel ID="up_Title" runat="server">
        <ContentTemplate>
            <asp:ImageButton ID="imb_Add" runat="server" ImageUrl="~/System/Design/ico/24x24/user1_new.png" CssClass="ActionImgButton" ToolTip="<%$ Resources:dcCommon, dc_New %>" 
                onclick="imb_Add_Click" Visible="false" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="SiteFox_Main" Runat="Server">
    <asp:UpdatePanel ID="up_Main" runat="server">
        <ContentTemplate>
            <div style="display: block; float: left; width: 220px; height: auto; overflow: auto; border-right: solid 1px #444;">
                <asp:RadioButtonList ID="rbl_SelectSoruce" runat="server" AutoPostBack="true" RepeatDirection="Horizontal">
                    <asp:ListItem Selected="True" Text="<%$ Resources:dcCommon, dc_System %>" Value="System" />
                    <asp:ListItem Text="<%$ Resources:dcCommon, dc_Web %>" Value="Web" />
                </asp:RadioButtonList>
                <asp:TreeView ID="tv_System" runat="server" LeafNodeStyle-HorizontalPadding="3" NodeStyle-HorizontalPadding="3" SelectedNodeStyle-CssClass="SelectedNodeStyle"
                    ShowExpandCollapse="True" ShowLines="true" CssClass="FormTable_TreeView" NodeStyle-CssClass="NodeStyle">
                    <RootNodeStyle ImageUrl="~/System/Design/ico/Common/folder_open.gif" />
                	<ParentNodeStyle ImageUrl="~/System/Design/ico/Common/folder.gif" />
                	<LeafNodeStyle ImageUrl="~/System/Design/ico/Common/folder.gif" />
                	<NodeStyle ImageUrl="~/System/Design/ico/Common/folder.gif" />
                    <Nodes>
                        <asp:TreeNode Text="<%$ Resources:dcCommon, dc_Content %>" Value="~/System/Pages/Content/" />
                        <asp:TreeNode Text="<%$ Resources:dcCommon, dc_Navigation %>" Value="~/System/Pages/Navigation/" />
                        <asp:TreeNode Text="<%$ Resources:dcCommon, dc_Settings %>" Value="~/System/Pages/Settings/" />
                        <asp:TreeNode Text="<%$ Resources:dcCommon, dc_Security %>" Value="~/System/Pages/Security/" />
                        <asp:TreeNode Text="<%$ Resources:dcCommon, dc_MyAccount %>" Value="~/System/Pages/MyAccount/" />
                        <asp:TreeNode Text="<%$ Resources:dcCommon, dc_HelpAndSupport %>" Value="~/System/Pages/HelpAndSupport/" />
                    </Nodes>
                </asp:TreeView>
                <ucc:TreeViewFileManger ID="tv_Web" runat="server" RootPath="~/Web" ShowFiles="false" Visible="false" />
            </div>
            <div style="display: block; float: right; width: 720px; height: auto;">
        		<asp:GridView runat="server" ID="gv_Rules" AutoGenerateColumns="false" RowStyle-CssClass="GridViewRow" Width="100%" GridLines="None" OnRowDataBound="RowDataBound">
        			<Columns>
        				<asp:TemplateField HeaderText="<%$ Resources:dcCommon, dc_Action %>" ItemStyle-HorizontalAlign="Center">
        					<ItemTemplate>
        						<%# GetAction((System.Web.Configuration.AuthorizationRule)Container.DataItem) %>
        					</ItemTemplate>
        				</asp:TemplateField>
        				<asp:TemplateField HeaderText="<%$ Resources:dcCommon, dc_Roles %>" ItemStyle-HorizontalAlign="Center">
        					<ItemTemplate>
        						<%# GetRole((System.Web.Configuration.AuthorizationRule)Container.DataItem)%>
        					</ItemTemplate>
        				</asp:TemplateField>
        				<asp:TemplateField HeaderText="<%$ Resources:dcCommon, dc_User %>" ItemStyle-HorizontalAlign="Center">
        					<ItemTemplate>
        						<%# GetUser((System.Web.Configuration.AuthorizationRule)Container.DataItem)%>
        					</ItemTemplate>
        				</asp:TemplateField>
        				<asp:TemplateField HeaderText="<%$ Resources:dcCommon, dc_DeleteRole %>" ItemStyle-HorizontalAlign="Center">
        					<ItemTemplate>
        						<asp:ImageButton ID="imb_Delete" runat="server" ImageUrl="~/System/Design/ico/16x16/delete2.png" 
        						    CommandArgument="<%# (System.Web.Configuration.AuthorizationRule)Container.DataItem %>" OnClick="DeleteRule" />
        					</ItemTemplate>
        				</asp:TemplateField>
        				<asp:TemplateField HeaderText="<%$ Resources:dcCommon, dc_MoveRole %>" ItemStyle-HorizontalAlign="Center">
        					<ItemTemplate>
        						<asp:ImageButton ID="imb_Up" runat="server" ImageUrl="~/System/Design/ico/16x16/arrow_up_green.png" 
        						    CommandArgument="<%# (System.Web.Configuration.AuthorizationRule)Container.DataItem %>" OnClick="MoveUp" />
        						<asp:ImageButton ID="imb_Down" runat="server" ImageUrl="~/System/Design/ico/16x16/arrow_down_green.png" 
        						    CommandArgument="<%# (System.Web.Configuration.AuthorizationRule)Container.DataItem %>" OnClick="MoveDown" />
        					</ItemTemplate>
        				</asp:TemplateField>
        			</Columns>
        		</asp:GridView>

                <asp:Panel ID="pan_Add" runat="server" Visible="false">
                    <div class="ActionPanel_Background"></div>
                    <div class="ActionPanel">
                        <div class="ActionPanel_Header">
                            <asp:Label ID="lab_Add_Title" runat="server" Text="<%$ Resources:dcCommon, dc_Add %>" />
                            <asp:ImageButton ID="imb_Add_Close" runat="server" CssClass="ActionPanel_Close" ImageUrl="~/System/Design/ico/24x24/delete.png" onclick="imb_Add_Close_Click" />
                        </div>
                        <div class="ActionPanel_Content">
                            <div class="FieldTemplates_Row">
                                <asp:Label ID="lb_Action_Title" runat="server" CssClass="Label" Text="<%$ Resources:dcCommon, dc_Action %>" />
                                <asp:RadioButtonList ID="rbl_Action_Value" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Selected="True" Text="<%$ Resources:dcCommon, dc_Deny %>" Value="false" />
                                    <asp:ListItem Text="<%$ Resources:dcCommon, dc_Allow %>" Value="true" />
                                </asp:RadioButtonList>
                            </div>
                            <div class="FieldTemplates_Row">
                                <asp:Label ID="lb_RuleAppliesTo_Title" runat="server" CssClass="Label" Text="<%$ Resources:dcCommon, dc_RuleAppliesTo %>" />
                                <asp:RadioButtonList ID="rbl_RuleAppliesTo_Value" runat="server" Width="180" style="display: block; float: left;">
                                    <asp:ListItem Selected="True" Text="<%$ Resources:dcCommon, dc_ThisRole %>" Value="ApplyRole" />
                                    <asp:ListItem Text="<%$ Resources:dcCommon, dc_ThisUser %>" Value="ApplyUser" />
                                    <asp:ListItem Text="<%$ Resources:dcCommon, dc_AllUsers %>" Value="ApplyAllUsers" />
                                    <asp:ListItem Text="<%$ Resources:dcCommon, dc_AnonymousUsers %>" Value="ApplyAnonUser" />
                                </asp:RadioButtonList>
                                <div style="width: 300px; display: block; float: left; height: auto;">
                                    <asp:DropDownList ID="UserRoles" runat="server" AppendDataBoundItems="true" style="margin-top: 5px; width: 100%;">
                            		    <asp:ListItem>Select Role</asp:ListItem>
                            		</asp:DropDownList>
                                    <asp:DropDownList ID="UserList" runat="server" AppendDataBoundItems="true" style="margin-top: 5px; width: 100%;">
                            			<asp:ListItem>Select User</asp:ListItem>
                            		</asp:DropDownList>
                                </div>
                            </div>
                            <ucc:MessageText ID="ucc_Add_Message" runat="server" />
                            <div class="FieldTemplates_Row">
                                <asp:LinkButton ID="lib_Add_Ok" runat="server" CssClass="LinkButton" ValidationGroup="mainValGroup" 
                                    onclick="lib_Add_Ok_Click" Text="<%$ Resources:dcCommon, dc_Add %>" />
                            </div>
                        </div>
                    </div>
                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

